package com.example.pojo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 记录URL请求耗时 BO
 */
public class UrlLogBo {


    private String methodName;

    private List<Long> useTimeList;

    private int numOfCall; //对象被调用的次数

    public UrlLogBo(String methodName) {
        useTimeList = new ArrayList();
        numOfCall = 0;
        this.methodName = methodName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public int getNumOfCall() {
        return numOfCall;
    }

    public void setNumOfCall(int numOfCall) {
        this.numOfCall = numOfCall;
    }

    public void putTime(long time){
        useTimeList.add(time);
    }

    public List<Long> getUseTimeList() {
        if(useTimeList.size() > 0)
            Collections.sort(useTimeList);
        return useTimeList;
    }

    public void cleanList(){
        useTimeList.clear();
    }

}
